<template>

	<view class="avatar" :style="{
			width:size,
			height:size,
			backgroundImage:'url('+src+')'
		}" @click="navTo">
		<!-- 		<u-image :src="src" mode="aspectFit" :width="size"
				:height="size"></u-image> -->
	</view>

</template>

<script>
	export default {
		name: "avatar",
		props: {
			userId: {
				type: String,
				default: "",
			},

			src: {
				type: String,
				default: "",
			},
			size: {
				type: String,
				default: "48px",
			}

		},
		data() {
			return {

			};
		},
		methods: {
			navTo() {
				if (this.userId) {
					this.$func.toUrl("/pages/staff/detail?id=" + this.userId)
				}
			}
		}
	}
</script>

<style scoped>
	.avatar {
		border-radius: 50%;
		background-size: cover;
	}
</style>